import argparse
from pathlib import Path
from .openanno import Annotator


def set_annotation_parser(parser: argparse.ArgumentParser):
    parser.add_argument("--genepred_file", "-genepred", type=Path, required=True, help="input, genepred file")
    parser.add_argument("--gene_id_file", "-gene_id", type=Path, required=True, help="input, gene id file")
    parser.add_argument("--cytoband_file", "-cytoband", type=Path, help="input, cytoband file")
    parser.add_argument("--bed_files", "-bed", nargs="+", type=Path, help="input, cytoband file")
    parser.add_argument("--overlap", "-overlap", type=float, default=0.7, help="input, overlap rate")


def main():
    parser = argparse.ArgumentParser(description="Auto CNVKit")
    parser.add_argument("--input_file", "-in", type=Path, required=True, help="input, input vcf file")
    parser.add_argument("--output_file", "-out", type=Path, required=True, help="input, output vcf file")
    set_annotation_parser(parser=parser)
    parser.set_defaults(func=lambda args: Annotator.model_validate(**vars(args)).run())
    args = parser.parse_args()
    args.func(args)
